package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IRecommentProductDao;
import com.financing.platform.dto.RecommentProductDTO;
import com.financing.platform.util.SqlName;

@Repository("recommentProductDaoImpl")
public class RecommentProductDaoImpl extends BaseDaoImpl implements IRecommentProductDao {

	@Override
	public int addRecommentProduct(RecommentProductDTO recommentProduct)
			throws SQLException {
		this.sqlMapClient.insert(SqlName.insertRecommentProduct,recommentProduct);
		return 0;
	}

	@Override
	public int deleteRecommentProduct(RecommentProductDTO recommentProduct)
			throws SQLException {
		this.sqlMapClient.update(SqlName.deleteRecommentProduct,recommentProduct);
		return 0;
	}

	@Override
	public List<Map<String, String>> queryRecommentProduct(
			RecommentProductDTO recommentProduct) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.queryRecommentProduct,recommentProduct);
	}

	@Override
	public int queryRecommentProductCount(
			RecommentProductDTO recommentProduct) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.queryRecommentProductCount,recommentProduct);
	}


}
